package cn.gov.pbc.gd.credit.vo.center.query;

import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.Map;

import com.liu.tools.StrUtil;

/**
 * @author liuxingmi
 * @datetime 2017年6月5日 上午11:44:04
 * @desc 征信查询第一步请求数据
 */
public class ReqFirstStepVo  implements Serializable{
	/**
	 * 
	 */
	private static final long serialVersionUID = 2001787029043737056L;

	//branchquery/innerQueryChargeAction.do?forwardtype=4&nexttype=1&querytype=24&user=������&ctype=0
	//&idno=412822198212021417&reltel=&relname=&relcerttype=&relcertno= 

	
	private String forwardtype;
	
	/**
	 * 查询步骤
	 */
	private String nexttype;

	/**
	 * 查询类型(24-个人明细版，21-个人简单版)
	 */
	private String querytype;
	
	/**
	 * 用户姓名
	 */
	private String user;
	
	/**
	 * 证件类型
	 */
	private String ctype;
	
	/**
	 * 证件号码
	 */
	private String idno;
	
	/**
	 * 代理人联系方式
	 */
	private String reltel;
	
	/**
	 * 代理人姓名
	 */
	private String relname;
	
	/**
	 * 代理人证件类型
	 */
	private String relcerttype;
	
	/**
	 * 代理人证件号码
	 */
	private String relcertno;

	private Map<String, String> cookies;
	
	public String getForwardtype() {
		return forwardtype;
	}

	public void setForwardtype(String forwardtype) {
		this.forwardtype = forwardtype;
	}

	public String getNexttype() {
		return nexttype;
	}

	public void setNexttype(String nexttype) {
		this.nexttype = nexttype;
	}

	public String getUser() {
		return user;
	}

	public void setUser(String user) {
		this.user = user;
	}

	public String getCtype() {
		return ctype;
	}

	public void setCtype(String ctype) {
		this.ctype = ctype;
	}

	public String getIdno() {
		return idno;
	}

	public void setIdno(String idno) {
		this.idno = idno;
	}

	public String getReltel() {
		return reltel;
	}

	public void setReltel(String reltel) {
		this.reltel = reltel;
	}

	public String getRelname() {
		return relname;
	}

	public void setRelname(String relname) {
		this.relname = relname;
	}

	public String getRelcerttype() {
		return relcerttype;
	}

	public void setRelcerttype(String relcerttype) {
		this.relcerttype = relcerttype;
	}

	public String getRelcertno() {
		return relcertno;
	}

	public void setRelcertno(String relcertno) {
		this.relcertno = relcertno;
	}

	public String getQuerytype() {
		return querytype;
	}

	public void setQuerytype(String querytype) {
		this.querytype = querytype;
	}
	
	public Map<String, String> getCookies() {
		return cookies;
	}

	public void setCookies(Map<String, String> cookies) {
		this.cookies = cookies;
	}

	@Override
	public String toString() {
		try {
			if(StrUtil.isNotNull(user)){
				user = URLEncoder.encode(user,"GBK");
			}
			if(StrUtil.isNotNull(relname)){
				relname = URLEncoder.encode(relname,"GBK");
			}
			if(StrUtil.isNotNull(idno)){
				idno = URLEncoder.encode(idno,"GBK");
			}
			if(StrUtil.isNotNull(relcertno)){
				relcertno = URLEncoder.encode(relcertno,"GBK");
			}
		} catch (UnsupportedEncodingException e) {
			
		}
		return  ("forwardtype=" + forwardtype + "&nexttype=" + nexttype + "&querytype=" + querytype
				+ "&user=" + user + "&ctype=" + ctype + "&idno=" + idno + "&reltel=" + reltel + "&relname="
				+ relname + "&relcerttype=" + relcerttype + "&relcertno=" + relcertno + "").replaceAll("null", "");
	}
	
}
